@extends('default.layouts.companyRegisterHF')
@section('title')企业会员注册 | {{Site::get('webname')}} @endsection
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/company/register.css')}}">
@endsection

@section('content')
    {{--企业会员注册信息--}}
    <div class="content">
        <div class="reg">
            <div class="regInfo">
                {{--企业会员注册--}}
                <div class="headTop">
                    <div class="rCorporate"><span>注册企业账号</span></div>
                </div>
                {{--公司信息--}}
                <form action="{{url('company/post_register_basic')}}" method="post" name="regBasicForm" id="regBasicForm">
                    {{csrf_field()}}
                    <div class="regForm comInfo">
                        {{--输出全部错误信息--}}
                        @if(count($errors)>0)
                            <div class="errors" style="padding-bottom: 10px">
                                <ul>
                                    @if(is_object($errors))
                                        @foreach($errors->all() as $error)
                                            <li><span>{{$error}}</span></li>
                                        @endforeach
                                    @else
                                        <li><span>{{$error}}</span></li>
                                    @endif
                                </ul>
                            </div>
                        @endif
                        <div class="fTitle">
                            <span class="line"><span>基本信息</span></span>
                        </div>
                        <div class="formCon">
                            <dl>
                                <dt><span class="caption">公司名称</span><span class="asterisk">*</span></dt>
                                <dd><input type="text" name="company_name" id="company_name" value="{{$userInfo->company_name}}" placeholder="请输入公司名称" tip="请输入公司名称"></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">品牌</span></dt>
                                <dd><input type="text" name="brands" id="brands" style="width: 222px;"  value="{{old('brands')}}" placeholder="请输入公司品牌" tip="请输入公司品牌"></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">公司性质</span><span class="asterisk">*</span></dt>
                                <dd>
                                    <input id="comkind" name="comkind" type="hidden">
                                    <div id="comkind_select" class="select"><span><a></a></span><i></i></div>
                                </dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">所属行业</span><span class="asterisk">*</span></dt>
                                <dd>
                                    <input id="industry" name="industry" type="hidden">
                                    <div id="industry_select" class="select" style="width: 240px;" ><span><a></a></span><i></i></div>
                                </dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">成立年份</span><span class="asterisk">*</span></dt>
                                <dd>
                                    <div class="showTime" id="showTime">
                                        <input name="established" id="established" type="hidden" value="{{old('established')}}">
                                    </div>
                                </dd>
                                <dd class="errinfo"></dd>
                            </dl>

                            <dl>
                                <dt><span class="caption">员工数量</span><span class="asterisk">*</span></dt>
                                <dd>
                                    <input id="employee_num" name="employee_num" type="hidden">
                                    <div id="employee_num_select" class="select"><span><a></a></span><i></i></div>
                                </dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">公司诱惑</span><span class="asterisk">*</span></dt>
                                <dd style="width: 570px;">
                                    <span class="selTemptation"  id="selTemptation">
                                        <input name="temptation" value="{{old('temptation')}}" id="temptation" type="hidden">
                                        <input type="text" name="showTemptation" id="showTemptation" value="{{old('temptation')}}" readonly style="cursor: text" placeholder="例如：包吃，包住，五险一金，老板人好">
                                        <i class="yicon"></i>
                                    </span>
                                </dd>
                                <dd class="errinfo" style="width: 140px;"></dd>
                            </dl>
                            <dl style=" height: 112px;">
                                <dt style=" height: 112px;"><span class="caption">公司简介</span><span class="asterisk">*</span></dt>
                                <dd style=" height: 112px;"><textarea name="profile" id="profile" placeholder="请输入公司简介" tip="请输入公司简介">{{old('profile')}}</textarea></dd>
                                <dd class="errinfo" style="width: 140px;"></dd>
                            </dl>
                        </div>
                    </div>

                    {{--联系方式--}}
                    <div class="regForm comInfo">
                        <div class="fTitle">
                            <span class="line"><span>联系方式</span></span>
                        </div>
                        <div class="formCon">
                            <dl>
                                <dt><span class="caption">联系人</span><span class="asterisk">*</span></dt>
                                <dd><input type="text" name="contacts" id="contacts"  style=" width: 180px;" value="{{$userInfo->contacts}}"  placeholder="请输入联系人" tip="请输入联系人"></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">手机号码</span></dt>
                                <dd><input type="text" name="mobile" id="mobile" value="{{$userInfo->mobile}}" style=" width: 120px;"  placeholder="请输入手机号码"  tip="请输入手机号码"></dd>
                                <dd class="errinfo"></dd>
                            </dl>

                            <dl>
                                <dt><span class="caption">联系电话</span></dt>
                                <dd>
                                    <input type="text" name="area_code" id="area_code" style="width:50px;"  value="{{$phone[0] or ''}}" placeholder="区号">
                                    <input type="text" name="phone" id="phone" style="width:140px; margin-left: 10px;"  value="{{$phone[1] or ''}}" placeholder="固定电话" tip="请输入电话">
                                    <input type="text" name="ext" id="ext" style="width:50px;margin-left: 10px;"  value="{{$phone[2] or ''}}" placeholder="分机号">
                                </dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl style=" margin: 0" >
                                <dt></dt>
                                <dd class="tips"><span class="asterisk">*</span>固定电话与手机号码必须填写一项</dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">传真</span></dt>
                                <dd><input type="text" name="fax" id="fax" value="{{old('fax')}}" style=" width: 160px;" placeholder="请输入传真号码" tip="请输入传真号码" ></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">电子邮件</span></dt>
                                <dd><input type="text" name="email" id="email" value="{{$userInfo->email}}" style=" width:240px;" placeholder="请输入电子邮件" tip="请输入电子邮件"></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">QQ号码</span></dt>
                                <dd><input type="text" name="qq" id="qq" value="{{old('qq')}}" style=" width: 160px;" placeholder="请输入QQ号码"  tip="请输入QQ号码"></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">所在地区</span><span class="asterisk">*</span></dt>
                                <dd>
                                    <input id="region" name="region" type="hidden" value="{{old('region')}}" >
                                    <input id="province" name="province" type="hidden" >
                                    <div id="province_select" class="select"  ><span><a></a></span><i></i></div>
                                    <input id="area" name="area" type="hidden">
                                    <div id="area_select" class="select" style="margin-left: 5px;" ><span><a></a></span><i></i></div>
                                    <input id="city" name="city" type="hidden">
                                    <div id="city_select" class="select" style="margin-left: 5px;"><span><a></a></span><i></i></div>
                                </dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">详细地址</span><span class="asterisk">*</span></dt>
                                <dd>
                                    <input type="text" name="address" id="address" style="width:400px;" value="{{old('address')}}" placeholder="请输入详细地址" tip="请输入详细地址">
                                </dd>
                                <dd class="errinfo" style="width: 140px;"></dd>
                            </dl>

                            <dl class="setMapCss">
                                <dt></dt>
                                <dd>
                                    <input name="position" type="hidden" id="position" value="{{old('position')}}"  />
                                    <input name="coordinate_address" type="hidden" id="coordinate_address" value="{{old('coordinate_address')}}"  />
                                    <input name="longitude" type="hidden" id="longitude" value="{{old('longitude')}}"  />
                                    <input name="latitude" type="hidden" id="latitude" value="{{old('latitude')}}"  />
                                    <span class="setmap"><a id="setMap">设置坐标</a></span>
                                    @if(old('maparea'))
                                        <span class="noset" id="noset" style="color: #999">已设置地图位置:{{old('maparea')}}</span>
                                        @else
                                        <span class="noset" id="noset">未设置</span>
                                    @endif
                                </dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">公司网站</span></dt>
                                <dd><input type="text" name="website" id="website" style="width:240px;" value="{{old('website')}}" placeholder="请输入公司网站" tip="请输入公司网站" ></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">乘车路线</span></dt>
                                <dd><input type="text" name="lines" id="lines" value="{{old('lines')}}" style="width:400px;"  placeholder="请输入乘车路线" tip="请输入乘车路线" ></dd>
                                <dd class="errinfo"></dd>
                            </dl>

                            <dl style="margin-top: 30px;">
                                <dt></dt>
                                <dd><input type="submit" name="sub" id="sub" class="sub" value="完成注册" ></dd>
                            </dl>
                        </div>
                    </div>
                </form>
                {{--//注册表单--}}
            </div>
        </div>
    </div>
@endsection

@section('footerjs')
    @parent
    <!--弹出层显示职位诱惑posTemptation插件-->
    <div class="showPosTemptation" id="showPosTemptation"></div>
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.posTemptation.js')}}"></script>

    <!--选择地图定位map-->
    <div id="twobox_sceen" class="twobox_sceen"></div>
    <script type="text/javascript" src="{{asset('/default/js/company/setmap.js')}}"></script>

    <!--弹出层显示时间加载插件-->
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.autoTime.js')}}"></script>

    <script type="text/javascript" src="{{Resources::jsOption('company')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.validate.extend.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.enplaceholder.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/company/registerBasic.js')}}"></script>

    <!--地区三级联动-->
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.select.area.js')}}"></script>

    {{--JS信息--}}
    <script>

        var selectComkind=$("#comkind").select({ optionData:option_comkind,selected:5});
        //为这个对象添加一个新元素
        option_industry.unshift({"text":"请选择","value":''});
        var selectIndustry = $("#industry").select({ optionData:option_industry,selected:'{{old('industry')}}'});
        var selectEmployee_num = $("#employee_num").select({ optionData:option_employee_num,selected:'{{old('employee_num')}}'});
        //分帧显示地址
        var iframeMapUrl = "{{ url('company/iframe_map') }}";
        //公司诱惑
        var comTemp = ["双休","包吃","包住","五险","公积金","年终奖","旅游","培训","带薪年假","节日礼物","定期体检","免费班车","加班补贴","交通补贴",
                        "话费补贴","员工持股","岗位晋升","8小时工作制","项目提成","美女多","办公高大上","员工餐厅","健身房","活动室","配车"];
        $("#selTemptation").posTemptation({
            posArr:comTemp,                               //传入职位诱惑数组
            showPosTemptation:'#showPosTemptation',       //追加到什么位置
            posTemptation:"#temptation",                  //赋值到某个表单的值
            showTemptation:"#showTemptation"              //显示到某个表单的值
        });

        //基于包装集autoTime函数插件
        $("#showTime").autoTime({
            year:"year",                               //弹出层年份
            month:"month",                             //弹出层月份
            established:'#established'                 //成立年份id
        });

        //地区联动
        $("#region").selectArea({
            'province':$('#province'),
            'area':$('#area'),
            'city':$('#city'),
            'selected':"{{old('region')}}"
            //'provinceNull':true,
            //'areaNull':true,
            //'cityNull':true
        });
    </script>
@endsection